<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">

<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Pages </title>
	<?php echo javascript_defaults()?>
    <link rel="stylesheet" href="<?php echo get_installed_path() ?>/css/admin.css" type="text/css" media="screen" title="no title" charset="utf-8" />
    <script language="javascript" type="text/javascript" src="<?php echo get_installed_path() ?>/js/tiny_mce/tiny_mce_popup.js"></script>
    <style type="text/css" media="screen">
        body {
            text-align:left;
        }
    </style>
    <script type="text/javascript" charset="utf-8">
        function insertFile(from)
        {   
            var win = tinyMCE.getWindowArg("window");
            // insert information now
            win.document.getElementById(tinyMCE.getWindowArg("input")).value = $F(from);
            // close popup window
            tinyMCEPopup.close();
            return false;
        }
    </script>
</head>
<body>
    <div id='bd'>
        <p>Below is a list of any pages and news stories you have written. Choosing your item and pressing the Choose button will insert the url into the appropriate location</p>
        
        <p><b>Pages</b></p>
        <form action="" id="page_form">
            <select id='page_url'>
                <?php
                echo $pages->pages_to_list_options(0,0,true);
                ?>
            </select>
            <input type="submit" name="submit" value="Choose Page" id="Choose Page" onclick="insertFile('page_url');">
        </form>
        
        <p><b>News Stories</b></p>
        <form action="" id="news_form">
            <select id='news_url'>
                <?php
                $stories = $news->assoc_published();
                foreach ($stories as $url => $title) 
                {
                    printf("<option value='/news/read/%s'>%s</option>", $url, $title);
                }
                ?>
            </select>
            <input type="submit" name="submit" value="Choose News Story" id="Choose News" onclick="insertFile('news_url');">
        </form>
        

    </div>
</body>
</html>
